<?php $form=$this->beginWidget('booster.widgets.TbActiveForm',array(
	'id'=>'archivos-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>

<p class="help-block">Fields with <span class="required">*</span> are required.</p>

<?php //echo $form->errorSummary($model); ?>
 <?php 
        foreach(Yii::app()->user->getFlashes() as $key => $message) {
            echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
        }
    ?>
	<?php //echo $form->textFieldGroup($model,'tipo_archivo_id',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5')))); 
  			echo $form->dropDownListGroup($model,'tipo_archivo_id',
                                            array(
                                                    'wrapperHtmlOptions' => array(
                                                            'class' => 'col-sm-5',
                                                    ),
                                                    'label'=>'Tipo de archivo',
                                                    'widgetOptions' => array(
                                                            //'id'=>'partida',
                                                            //'name'=>'partida',
                                                            'data' =>CHtml::listData(TiposArchivos::model()->findAll(),'id',function($tipo){return $tipo->tipo.' - '.$tipo->ext;}),
                                                            //'options'=>array($model->proyecto_id => array('selected'=>true)),
                                                            'htmlOptions' => array('id'=>'tipo_archivo', 'prompt' => 'Seleccionar tipo de archivo', //'onChange'=>'submit','submit' => array('/planificacion/importado','#'=>'partida') 
                                                                                                            ),
                                                    ),
                                                    'hint' => 'Tipo de archivo a cargar.'
                                            ));

	?>
	
	<?php //echo $form->textFieldGroup($model,'ruta',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5','maxlength'=>255)))); 

			echo $form->fileFieldGroup($model, 'archivo',
				array(
					'wrapperHtmlOptions' => array(
						'class' => 'col-sm-5',
					),
				)
			);
			 /*$this->widget('booster.widgets.TbFileUpload', array(
			    'url' => $this->createUrl("archivos/upload"),
			    'model' => $model,
			    'attribute' => 'ruta', // see the attribute?
			    'multiple' => false,
			    'options' => array(
			    'maxFileSize' => 2000000,
			    'acceptFileTypes' => 'js:/(\.|\/)(gif|jpe?g|png)$/i',
			))); */
	?>

	<?php echo $form->textFieldGroup($model,'titulo',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5','maxlength'=>255)))); ?>

	<label class="control-label required" for="Archivos_descripcion">Cuerpo de la noticia<span class="required">*</span></label>
	
	<?php $this->widget('application.extensions.eckeditor.ECKEditor', array(
                'model'=>$model,
                'attribute'=>'descripcion',
               // 'name' => 'descripcion',
                'config' => array(
                    'toolbar'=>array(
                        array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Format', 'Font', 'FontSize', 'NumberedList', 'BulletedList',  'Strike', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'),
                        //array( 'Image', 'Link', 'Unlink', 'Anchor' ) ,
                    ),
                  ),
                )); 
     ?>
	<?php //echo $form->textAreaGroup($model,'descripcion', array('widgetOptions'=>array('htmlOptions'=>array('rows'=>6, 'cols'=>50, 'class'=>'span8')))); ?>

	<?php //echo $form->textFieldGroup($model,'creado_por',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5')))); ?>

	<?php //echo $form->datePickerGroup($model,'fecha_publicacion',array('widgetOptions'=>array('options'=>array(),'htmlOptions'=>array('class'=>'span5')), 'prepend'=>'<i class="glyphicon glyphicon-calendar"></i>', 'append'=>'Click on Month/Year to select a different Month/Year.')); ?>



	<?php echo $form->textFieldGroup($model,'ante_titulo',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5','maxlength'=>200)))); ?>

	<?php echo $form->textFieldGroup($model,'sumario',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5','maxlength'=>200)))); ?>

	<?php echo $form->textFieldGroup($model,'contenido',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5','maxlength'=>200)))); ?>

	<?php //echo $form->textFieldGroup($model,'thumbnail',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5','maxlength'=>255)))); ?>

<div class="form-actions">
	<?php $this->widget('booster.widgets.TbButton', array(
			'buttonType'=>'submit',
			'context'=>'primary',
			'label'=>$model->isNewRecord ? Yii::t('msg','Crear') : Yii::t('msg','Guardar'),
		)); ?>
</div>

<?php $this->endWidget(); ?>
